<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>TODO supply a title</title>
    </head>
    <body>
        <f:view>
        <h:form prependId="false">

            <p:dataGrid var="car" value="#{tableBean.cars}" columns="3"
                        rows="12" paginator="true" effect="true"
                        paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                        rowsPerPageTemplate="9,12,15">

                <p:column>
                    <p:panel header="#{productManagedBean.listPro}" style="text-align:center">
                        <h:panelGrid columns="1" style="width:100%">
                                        <h2>
                                            <h:outputText value="#{item.productName}"/>
                                        </h2>

                                        <p:graphicImage  width="270" height="151" alt="port" value="#{item.image}"/>
                                        <p>ngay san xuat
                                            <h:outputText value="#{item.dateOfManufacture}">
                                                <f:convertDateTime pattern="MM/dd/yyyy"/>
                                            </h:outputText>
                                        </p>
                                        <p:commandLink update="carDetail"  title="View Detail">
                                            <p:graphicImage value="resources/images/search.png"/>
                                            <f:setPropertyActionListener value="#{item}"
                                                                         target="#{productManagedBean.pro.productID}" />
                                        </p:commandLink>

                                        <p:commandLink action="/Shoppingcart" title="Buy" ajax="false" actionListener="#{productManagedBean.addToShoppingCart}">
                                            <p:graphicImage value="resources/images/search.png" alt="more news" styleClass="morenews"/>
                                            <f:param value="#{item.productID}"  name="proID"/>
                                            <f:param value="#{item.category.categoryID}"  name="cateID"/>
                                        </p:commandLink>
                        </h:panelGrid>
                    </p:panel>
                </p:column>

            </p:dataGrid>

        </h:form>
    </body>
</html>
